<template>
  <van-dialog
    v-model:show="show"
    v-bind="computedAttrs"
    :show-confirm-button="false"
    show-cancel-button
  >
  <PdfViewer :src="props.url" style="max-height: 70vh;"/>
  </van-dialog>
</template>
<script setup name="I-Pdf-Dialog">
import  PdfViewer  from '@vue-office/pdf'
const show = defineModel({ type: Boolean, default: true })
const props = defineProps({
  title: {
    type: String,
    default: '预览'
  },
  url: {
    type: String,
    default: ''
  }
})

const $attrs = useAttrs()
// 计算属性，合并 props 和 $attrs
const computedAttrs = computed(() => {
  return {
    ...$attrs,
    title: props.title
  }
})
</script>

